package com.atguigu.algorithm;

import java.util.Scanner;
class Date {
    public int year;
    public int month;
    public int day;

    public Date(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }
}
public class TaobaoShop {
    public static boolean isLeapYear(int year){
        if(year%400==0 || (year%4==0 && year%100!=0)){
            return true;
        }else{
            return false;
        }
    }
    public static boolean isPrimeNum(int month) {
        if (month == 2 || month == 3 || month == 5 || month == 7 || month == 11) {
            return true;
        } else {
            return false;
        }
    }
    public static int addByMonth(int month,Date from,Date to,int sum){
        if(from.getMonth()==1){
            sum+=62;
        }else if(from.getMonth()==2){
            if(isLeapYear(from.getYear())){
                sum+=29;
            }else{
                sum+=28;
            }
        }else if(from.getMonth()==3){
            sum+=31;
        }else if(from.getMonth()==4){
            sum+=60;
        }else if(from.getMonth()==5){
            sum+=31;
        }else if(from.getMonth()==6){
            sum+=60;
        }else if(from.getMonth()==7){
            sum+=31;
        }else if(from.getMonth()==8){
            sum+=62;
        }else if(from.getMonth()==9){
            sum+=60;
        }else if(from.getMonth()==10){
            sum+=62;
        }else if(from.getMonth()==11){
            sum+=30;
        }else if(from.getMonth()==12){
            sum+=62;
        }
        return sum;
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextInt()){
            Date from=new Date(scanner.nextInt(),scanner.nextInt(),scanner.nextInt());
            Date to=new Date(scanner.nextInt(),scanner.nextInt(),scanner.nextInt());
            boolean flag=false; //用于判断当前月份是否是闰年
            int sum=0; //赚的钱
            //可以先计算闰年与非闰年的时候一整年赚的钱
            //31 28 31 30 31 30 31 31 30 31 30 31
            // 1  2  3  4  5  6  7  8  9 10 11 12
            //   润   润    润    润          润
            if(isPrimeNum(from.getMonth())){
                sum-=from.getDay()-1;
            }else{
                sum-=(from.getDay()-1)*2;
            }
            while(from.getYear()<to.getYear()){
                while(from.getMonth()<=12){
                    sum=addByMonth(from.getMonth(),from,to,sum);
                    from.setMonth(from.getMonth()+1);
                }
                from.setYear(from.getYear()+1);
                from.setMonth(1);
            }
            //跳出循环表示此时年份已相同,进行月份的循环
            while(from.getMonth()<to.getMonth()){
                if(from.getMonth()==1){
                    sum+=62;
                }else if(from.getMonth()==2){
                    if(isLeapYear(from.getYear())){
                        sum+=29;
                    }else{
                        sum+=28;
                    }
                }else if(from.getMonth()==3){
                    sum+=31;
                }else if(from.getMonth()==4){
                    sum+=60;
                }else if(from.getMonth()==5){
                    sum+=31;
                }else if(from.getMonth()==6){
                    sum+=60;
                }else if(from.getMonth()==7){
                    sum+=31;
                }else if(from.getMonth()==8){
                    sum+=62;
                }else if(from.getMonth()==9){
                    sum+=60;
                }else if(from.getMonth()==10){
                    sum+=62;
                }else if(from.getMonth()==11){
                    sum+=30;
                }else if(from.getMonth()==12){
                    sum+=62;
                }
                from.setMonth(from.getMonth()+1);
            }
            //只剩天数了
            int tmp=0;
            if(isPrimeNum(from.getMonth())){
                tmp=to.getDay();
            }else{
                tmp=2*(to.getDay());
            }
            sum+=tmp;
            System.out.println(sum);
        }
    }
}
